{% extends "base.html" %}

{% block content %}
<div class="container">
    {% if not user.is_authenticated %}
	<div class="hero-unit">
		<h2>Sign in to continue or Register to start your planning.</h2>
	</div>
    <div class="row">
		<div class="span6">
			<h2>Manage Run History</h2>
			<h5>Keep track of your run history through logging with details and notes.</h5>
		</div>
		<div class="span6">
			<h2>Join Events</h2>
			<h5>Create or Join upcoming events</h5>
		</div>
	</div>
    {% else %}
    <div class="hero-unit">
		<h2>Welcome, {{ user.userprofile.facebook_name }} to MarathonPlanner</h2>
        <h3>Start tracking for your next marathon</h3>
	</div>
	<div class="row">
		<div class="span6">
			<h2>Recent Activity</h2>
            <ul>
            {% for run in activity %}
                <li>{{ run.date|date:"SHORT_DATE_FORMAT" }}  - {{ run.name }}</li>
            {% endfor %}
            </ul>
		</div>
		<div class="span6">
			<h2>Upcoming Events</h2>
            {% for event in events %}
                <li>{{ event.date|date:"SHORT_DATE_FORMAT" }} {{ event.time|time:'h:i A' }} - <a href="{% url event_view event.id %}">{{ event.name }}</a></li>
            {% endfor %}
		</div>
	</div>
    {% endif %}
</div>
{% endblock %}
